<!DOCTYPE html>
<html>
	<head lang="en">
		<meta charset="utf-8" />
		<title>个人信息</title>
		<link rel="stylesheet" type="text/css" href="css/public.css"/>
		<link rel="stylesheet" type="text/css" href="css/mygrxx.css" />
		<script src="X-admin/js/jquery.js"></script>
		<script src="X-admin/lib/layui/layui.js"></script>
		<script src="X-admin/js/xadmin.js"></script>
		<link rel="stylesheet" href="X-admin/css/xadmin.css">
		<script src="js/common.js"></script>
	</head>
	<body>
		<!------------------------------head------------------------------>
		<div class="head" id="top"></div>
		<!------------------------------idea------------------------------>
		<div class="address mt">
			<div class="wrapper clearfix">
				<a href="index.html" class="fl">首页</a>
				<span>/</span>
				<a href="lessors-mygrxx.html" class="on">个人信息</a>
			</div>
		</div>
		
		<!------------------------------Bott------------------------------>
		<div class="Bott">
			<div class="wrapper clearfix">
				<div class="zuo fl">
					<h3>
						<a href="#"><img src="img/default.jpeg" style="width: 100px;height: 100px;border-radius:60%" id="zuo-head"/></a>
						<p class="clearfix"><span class="fl" id="name">[羊羊羊]</span><span class="fr">[退出登录]</span></p>
					</h3>

					<ul class="layui-nav layui-nav-tree" lay-filter="test">
						<li class="layui-nav-item">
							<a href="javascript:;" style="color: black;font-weight: bold">帐户管理</a>
							<dl class="layui-nav-child">
								<dd><a href="lessors-mygrxx.html">个人信息</a></dd>
								<dd><a href="lessors-remima.html">修改密码</a></dd>
							</dl>
						</li>
						<li class="layui-nav-item">
							<a href="javascript:;" style="color: black;font-weight: bold">财务中心</a>
							<dl class="layui-nav-child">
								<dd><a href="lessors-fiance.html">财务细明</a></dd>
								<dd><a href="lessors-fiance-dailyList.html">日报</a></dd>
								<dd><a href="lessors-fiance-monthlyList.html">月报</a></dd>
							</dl>
						</li>
						<li class="layui-nav-item">
							<a href="javascript:;" style="color: black;font-weight: bold">个人中心</a>
							<dl class="layui-nav-child">
								<dd><a href="lessors-station.html">我的工位</a></dd>
								<dd><a href="lessors-order-completed.html">工位订单</a></dd>
								<dd><a href="lessors-mygxin.html">我的活动</a></dd>
							</dl>
						</li>
					</ul>

				</div>
				<script>
					var Address_Prefix_Lessors = "http://localhost:9200/api-lessors";
				</script>
				<div class="you fl">
					<h2>修改密码</h2>
					<form  method="post" class="remima">
						<p><span>新密码：</span><input type="text" id="passwd" /></p>
						<p><span>重复新密码：</span><input type="text" id="passwd1" /></p>
						<input type="submit"  lay-submit lay-filter="update" value="提交" />
					</form>
				</div>
			</div>
		</div>

		<!--返回顶部-->
		<div class="gotop">
			<a href="cart.html">
			<dl>
				<dt><img src="img/gt1.png"/></dt>
				<dd>去购<br />物车</dd>
			</dl>
			</a>
			<a href="#" class="dh">
			<dl>
				<dt><img src="img/gt2.png"/></dt>
				<dd>联系<br />客服</dd>
			</dl>
			</a>
			<a href="lessors-mygrxx.html">
			<dl>
				<dt><img src="img/gt3.png"/></dt>
				<dd>个人<br />中心</dd>
			</dl>
			</a>
			<a href="#" class="toptop" style="display: none">
			<dl>
				<dt><img src="img/gt4.png"/></dt>
				<dd>返回<br />顶部</dd>
			</dl>
			</a>
			<p>400-800-8200</p>
		</div>
		<!--footer-->
		<div class="footer" id="foot"></div>
		<script src="js/jquery-1.12.4.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/public.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/user.js" type="text/javascript" charset="utf-8"></script>
	</body>
	<script>
		layui.use('form', function () {
			var form = layui.form;
			var data = JSON.parse(sessionStorage.getItem('data'));
			$("#name").html(data.buname); 	   	   //名称
			//设置头像
			$("#zuo-head").attr("src", data.buhead);

			form.on('submit(update)', function () {
				var field = {
					passwd: $("#passwd").val(),
					passwd1: $("#passwd1").val(),
					busiid:sessionStorage.getItem("busiid")
				};
				if ($("#passwd").val() !== $("#passwd1").val() && $("#passwd").val()!=null && $("#passwd").val()!=  null ){
					layer.msg("两次密码不一致",{time:1000});
				}else {
					console.log(field,1);
					$.ajax({
						url: Address_Prefix_Lessors + '/business/data/updatePassword',//地址：访问后台的地址
						data: field,//前端传递给后台的数据
						type: 'post',
						async: false,
						xhrFields: {
							withCredentials: true
						},
						crossDomain: true,
						dataType: 'json',//是后端传递到前端的数据格式
						success: function (data) {//后端给前端的一个反馈
							console.log(data);
							if (data.code === 0) {
								layer.msg("ok！",{time:1000}, function () {

								});
							}
						}
					});
				}
				return false;
			});
		});

	</script>
</html>
